package 多线程.Test;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class PalindromeCheck {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int k = scanner.nextInt();
            String s = scanner.next();

            boolean result = canFormPalindrome(s, k);
            if (result) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }


        scanner.close();
    }

    private static boolean canFormPalindrome(String s, int k) {
        if (k >= s.length()) {
            // 如果要删除的字符数量大于等于字符串长度，剩余字符一定可以组成回文字符串
            return true;
        }

        // 统计字符串中每个字符的出现次数
        Map<Character, Integer> charCount = new HashMap<>();
        for (char c : s.toCharArray()) {
            charCount.put(c, charCount.getOrDefault(c, 0) + 1);
        }

        int oddCount = 0;  // 记录字符出现次数为奇数的个数
        for (int count : charCount.values()) {
            if (count % 2 != 0) {
                oddCount++;
            }
        }

        // 最多只能删除奇数次出现的字符，因为删除后可以通过重排剩余字符变成回文字符串
        return oddCount <= k+1;
    }
}
